wayland: Use keyboard serial for implicit grab
authorOlivier Fourdan <ofourdan@redhat.com>
Thu, 30 Jun 2016 10:56:21 +0000 (12:56 +0200)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 20 Aug 2016 03:50:14 +0000 (23:50 -0400)
commitf9b91197c0a5ab29ba0c962b86e2f7ec535d5455
tree69af8602ed2aec9bd644d170e42fcaee915169d7
parent967e2e0cd371e0a3e4ac59aa55957b251c8bc2a6
wayland: Use keyboard serial for implicit grab

An xdg-popup requires a serial that the compositor will compare against
its own serial and will dismiss the popup if it doesn't match.

gtk+ uses either a pointer or touch serial for its helper function
_gdk_wayland_seat_get_last_implicit_grab_serial() but if the menu is
triggered before the user has had any pointer or touch interaction with
the client, using a keyboard shortcut, there is neither pointer nor
touch serial available, and gtk+ will use 0 as the default.

As a result, the compositor will instantly dismiss the xdg-popup. In
this case, gtk+ should use the keyboard serial instead.

Track keyboard serial as well and use the keyboard serial as the value
if there is no newer pointer or touch serial available.

https://bugzilla.gnome.org/show_bug.cgi?id=768017
gdk/wayland/gdkdevice-wayland.c